<!-- <template>
<layout class="home">
    <p v-if="$route.query.tab !== 'new'">我是首页</p>
    <p v-else>首页最新内容</p>

    <input type="text" name="" v-model="value">
    {{value}}
    <el-button>默认按钮</el-button>

    {{$store.state.site}}
</layout>
</template>

<script lang="ts">
import Vue from 'vue';
import layout from "@/components/layout.vue";
import Utils from "@/utils/index";

export default Vue.extend({
    name: 'home',
    metaInfo() {
        return {
            title: "home_home",
            meta: [{
                name: 'keyWords',
                content: 'My Example App'
            },{
                name: 'description',
                content: 'My description'
            }],
        }
    },
    components:{
        layout
    },
    data() {
        return {
            value: 'home'
        }
    },
    methods: {
        getData(){
            console.log('getData');
            this.value = 'baidu'
            this.$store.dispatch('SETSITE','www.baidu.com')
        }
    },
    mounted() {
        // this.$message('这是一条消息提示');

        setTimeout(function () {
            this.$store.dispatch('SETSITE','www.wkwkw.com')
        }.bind(this), 2000);
    },
    serverPrefetch(){
        return Promise.all([this.getData()]);
    }
});
</script> -->
<template>
<layout class="home">
    <p v-if="$route.query.tab !== 'new'">我是首页</p>
    <p v-else>首页最新内容</p>

    <input type="text" name="" v-model="value">
    {{value}}
    <el-button>默认按钮</el-button>

    {{$store.state.site}}
</layout>
</template>
<script lang="ts">
import {
    Component
} from "vue-property-decorator";
import Layout from "@/components/layout.vue";
import {
    BaseVue
} from "@/base-vue";
import Utils from "@/utils/";

@Component <AppComponent> ({
    components: {
        Layout
    },
    metaInfo() {
        return {
            title: "home_home",
            meta: [{
                name: 'keyWords',
                content: 'My Example App'
            },{
                name: 'description',
                content: 'My description'
            }],
        }
    },
    data(){
        return {
            value: '',
        }
    },
    // created () {
    // },
    methods:{
        async getTime(){
            let res = await this.request.post('http://api.admin.matchupexpo.com/admin/timestamp/getTimestamp')
            this.value = res.data
        },
    },
    mounted(){
        // this.getTime()
    }
})
export default class AppComponent extends BaseVue {
    public serverPrefetch() {
        return Promise.all([this.getTime()])
    }
}
</script>
